package com.xxx.client.android.api.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

import org.ksoap2.serialization.SoapPrimitive;

public class Vector2ListFunctions {

	public static String getString(SoapPrimitive soapPrimitive)
			throws RuntimeException {
		return soapPrimitive.toString();
	}

	public static List<String> getStringList(Object respone, String pre)
			throws RuntimeException {
		if (respone != null) {
			@SuppressWarnings("unchecked")
			Vector<SoapPrimitive> soapList = (Vector<SoapPrimitive>) respone;
			List<String> list = new ArrayList<String>(soapList.size());
			for (SoapPrimitive soapPrimitive : soapList) {
				list.add(pre == null ? ("" + soapPrimitive.toString()) : pre
						+ soapPrimitive.toString());
			}

			return list;
		}
		return null;
	}
}
